﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using Common.Utilities.DLR;

namespace Workflows.Components.Monitor
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    [OrmClass("WfDesignLog","WfDesignLogID",true)]
    public class WfDesignLog
    {
        private int _WfDesignLogID;
        /// <summary></summary>
        [OrmField("WfDesignLogID", SqlDbType.Int, 4, OrmFieldSerializationMethod.DefaultSerialization)]
        public int WfDesignLogID
        {
            get
            {
                return this._WfDesignLogID;
            }
            set
            {
                this._WfDesignLogID = value;
            }
        }

        private WfDesignLogType _LogType;
        /// <summary></summary>
        [OrmField("LogType",SqlDbType.Int,4,OrmFieldSerializationMethod.DefaultSerialization)]
        public WfDesignLogType LogType
        {
            get
            {
                return this._LogType;
            }
            set
            {
                this._LogType = value;
            }
        }

        private Guid _WfDesignID;
        /// <summary></summary>
        [OrmField("WfDesignID",SqlDbType.VarChar,50,OrmFieldSerializationMethod.DefaultSerialization)]
        public Guid WfDesignID
        {
            get
            {
                return this._WfDesignID;
            }
            set
            {
                this._WfDesignID = value;
            }
        }

        private DateTime _TimeStamp;
        /// <summary></summary>
        [OrmField("TimeStamp",SqlDbType.DateTime,8,OrmFieldSerializationMethod.DefaultSerialization)]
        public DateTime TimeStamp
        {
            get
            {
                return this._TimeStamp;
            }
            set
            {
                this._TimeStamp = value;
            }
        }

        private string _Operator;
        /// <summary></summary>
        [OrmField("Person",SqlDbType.VarChar,100,OrmFieldSerializationMethod.DefaultSerialization)]
        public string Operator
        {
            get
            {
                return this._Operator;
            }
            set
            {
                this._Operator = value;
            }
        }

        private string _MachineName;
        /// <summary></summary>
        [OrmField("Machine", SqlDbType.VarChar, 100, OrmFieldSerializationMethod.DefaultSerialization)]
        public string MachineName
        {
            get
            {
                return this._MachineName;
            }
            set
            {
                this._MachineName = value;
            }
        }

        private string _Message;
        /// <summary></summary>
        [OrmField("Message", SqlDbType.VarChar, 2000, OrmFieldSerializationMethod.DefaultSerialization)]
        public string Message
        {
            get
            {
                return this._Message;
            }
            set
            {
                this._Message = value;
            }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="wfID"></param>
        /// <param name="logType"></param>
        /// <param name="person"></param>
        /// <param name="machine"></param>
        /// <param name="msg"></param>
        public WfDesignLog(Guid wfID, WfDesignLogType logType, string person, string machine, string msg)
        {
            this._WfDesignLogID = 0;
            this._WfDesignID = wfID;
            this._LogType = logType;
            this._Operator = person;
            this._MachineName = machine;
            this._Message = msg;
            this._TimeStamp = DateTime.Now;
        }
    }
}
